import { AxiosResponse } from 'axios'
import axios from 'axios'


// IP地址检测
export function checkUserIp(): Promise<AxiosResponse<any, any>> {
    return axios.get('https://api.ipify.org/?format=json')
}

// 地域地址检测
export function checkUserAddress(ip: string): Promise<AxiosResponse<any, any>> {
    return axios.get(`https://opendata.baidu.com/api.php?query=${ip}&co=&resource_id=6006&oe=utf8`)
}
// export function checkUserAddress(ip: string): Promise<AxiosResponse<any, any>> {
//     return axios.get(`http://ip-api.com/json/${ip}?lang=zh-CN`)
// }
